﻿import com.dinmax.isolution.*

class ISAppGUI {
	
	private static var _instance:ISAppGUI;
	
	private var _buttonBar:ButtonBarGUI;
	
	public static function run(root:MovieClip):Void {
		if(!root) root = _root;
		_instance = new ISAppGUI(root);
		return;
	}
	public static function getActive():ISAppGUI {
		return _instance;
	}
	
	function ISAppGUI(root:MovieClip){
		//defino un par de cosas
		fscommand("fullscreen", true);
		Stage.scaleMode = "noScale";
		
		//cargo las ventanas
		loadMovieNum("detailWindow.swf", 1);
		
		//cargo la pantallita de usuario
		loadMovieNum("user_.swf", 2);
		
		ISMain.getInstance(root);
		return;
	};
	
	public function showWindow(window:String):Void {
		_level1.show(window);
		return;
	};
	
	public function hideWindow(window:String):Void {
		_level1.hide(window);
		return;
	};
	
	public function updateDevice(dev:Device):Void {
		_level1.updateDevice(dev);
		return;
	}
	
	public function updateTheme(theme:Theme):Void {
		_level1.updateTheme(theme);
		return;
	}
	
	public function registerButtonBar(bb:ButtonBarGUI):ISAppGUI {
		this._buttonBar = bb;
		return this;
	}
	public function getButtonBar():ButtonBarGUI {
		return this._buttonBar;
	}
	public function showPerson(p:Person):Void {
		//TODO mostrar la persona en pantalla
		_level2.showPerson(p);
		return;
	}
	
}